<* include file=$header_file *>

<script type="text/JavaScript">
	if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='<* $title*>&nbsp;&raquo;&nbsp;Edit <* $title*>';if(parent.$('add2custom')) parent.$('add2custom').innerHTML='<* $title*>';
</script>

<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.metadata.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script>

$.metadata.setType("attr", "validate"); // validate for radio or checkbox 

$(document).ready(function() { 
    // validate contact form on keyup and submit 
    $("#contact_form").validate();  
	//alert("last");
}); 
</script>

<form action="/<* $controller *>/opedit" method="post"  name="contact_form" id="contact_form" >
	<table class="tb tb2 ">
		<tr>
			<td colspan="4" class="td27">
			<input class="submit" id="submitbutton" type="submit" value=" Save "/>
			&nbsp;&nbsp;
			<input type="button" value=" Back to list " class="btn" onClick="history.back();"/>
			&nbsp;&nbsp; 
			<input  type="button" value="  Refresh " class="btn" onClick="window.location.reload()"/></td>
		</tr>			
		<tr>
			<th  class="partition" colspan="4">Contact</th>
		</tr>
		<tr>
			<td class="td22 red">Contact Type:</td>
			<td class="vtop ">
				<select name="Contact_Type" class="select required">
					<option value="">-- none --</option>
					<* html_options options=$field.Contact_Type selected=$result.Contact_Type *>
				</select>
			</td>
			<td class="td22 red">Contact Method:</td>
			<td class="vtop ">
				<select name="Contact_Method" class="select required">
					<option value="">-- none --</option>
					<* html_options options=$field.Contact_Method selected=$result.Contact_Method *>
				</select>			
			</td>
		</tr>
		<tr>
			<td class="td22 red">How did you hear about ARAFMI?</td>
			<td class="vtop ">
				<select name="Contact_Source" class="select required">
					<option value="">-- none --</option>
					<* html_options options=$field.Contact_Source selected=$result.Contact_Source *>
				</select>				
			</td>
			<td class="td22">Program:</td>
			<td class="vtop ">
				<select name="Contact_Program" class="select">
					<option value='null'>-- none --</option>
					<* html_options options=$field.Contact_Program selected=$result.Contact_Program *>
				</select>			
			</td>
		</tr>	
		<tr>
			<td class="td22">Referred By:</td>
			<td class="vtop ">
				<select name="Contact_Referred_By" class="select">
					<option value='null'>-- none --</option>
					<* html_options options=$field.Contact_Referred_By selected=$result.Contact_Referred_By *>
				</select>					
			</td>
			<td class="td22 red">Referred To:</td>
			<td class="vtop ">
				<select name="Contact_Referred_To" class="select required">
					<option value='null'>-- none --</option>
					<* html_options options=$field.Contact_Referred_To selected=$result.Contact_Referred_To *>
				</select>				
			</td>
		</tr>	
		<tr>
			<td class="td22">Contact Outcome:</td>
			<td class="vtop ">
				<select class="select" multiple name="Contact_Outcome[]">		
					<* html_options options=$field.Contact_Outcome selected=$multiSelected.Contact_Outcome *>
				</select>
			<td class="td22">Notes:</td>
			<td class="vtop "><textarea cols="50" name="Contact_Notes" id="Contact_Notes" rows="3" class="txt"><* $result.Contact_Notes *></textarea></td>
		</tr>		
		<tr>
			<th  class="partition" colspan="4">Client</th>
		</tr>    
		<tr>
			<td class="td22">First Name:</td>
			<td class="vtop "><input name="Client_First_Name" id="Client_First_Name" value="<* $result.Client_First_Name *>" type="text" class="txt" /></td>
			<td class="td22">Last Name:</td>
			<td class="vtop "><input name="Client_Last_Name" id="Client_Last_Name" value="<* $result.Client_Last_Name *>" type="text" class="txt" /></td>
		</tr>
		<tr>
			<td class="td22">Address 1:</td>
			<td class="vtop "><input name="Client_Address_1" id="Client_Address_1" value="<* $result.Client_Address_1 *>" type="text" class="txt" /></td>
			<td class="td22">Address 2:</td>
			<td class="vtop "><input name="Client_Address_2" id="Client_Address_2" value="<* $result.Client_Address_2 *>" type="text" class="txt" /></td>
		</tr>		
		<tr>
			<td class="td22">Suburb:</td>
			<td class="vtop "><input name="Client_Suburb" id="Client_Suburb" value="<* $result.Client_Suburb *>" type="text" class="txt" /></td>
			<td class="td22">State:</td>
			<td class="vtop "><input name="Client_State" id="Client_State" value="<* $result.Client_State *>" type="text" class="txt" /></td>
		</tr>	
		<tr>
			<td class="td22 red">Postcode:</td>
			<td class="vtop "><input name="Client_Postcode" id="Client_Postcode" size="20" value="<* $result.Client_Postcode *>" type="text" class="required" /></td>
			<td class="td22 red">Region:</td>
			<td class="vtop ">
				<select name="Client_Region" class="select required">
					<option value="">-- none --</option>
					<* html_options options=$field.Client_Region selected=$result.Client_Region *>
				</select>				
			</td>		
		</tr>		
		<tr>
			<td class="td22">Age Range:</td>
			<td class="vtop ">
				<select name="Client_Age_Range" class="select">
					<option value='null'>-- none --</option>
					<* html_options options=$field.Age_Range selected=$result.Client_Age_Range *>
				</select>				
			</td>
			<td class="td22 red">Gender:</td>
			<td class="vtop ">
				<* html_radios class="radio" name='Client_Gender' validate="required:true" options=$genderOptions selected=$result.Client_Gender *>
				<label for="Client_Gender" class="error">Please select a gender</label>
			</td>	
		</tr>	
		<tr>
			<td class="td22">Ethnicity:</td>
			<td class="vtop ">
				<select name="Client_Ethnicity" class="select required">
					<option value="">-- none --</option>
					<* html_options options=$field.Client_Ethnicity selected=$result.Client_Ethnicity *>
				</select>				
			</td>
			<td class="td22">Relationship to Consumer:</td>
			<td class="vtop ">
				<select name="Client_Relationship" class="select">
					<option value='null'>-- none --</option>
					<* html_options options=$field.Client_Relationship selected=$result.Client_Relationship *>
				</select>			
			</td>
		</tr>	
		<tr>
			<td class="td22">Member:</td>
			<td class="vtop "><* html_radios class="radio" name='Client_Member' options=$yesnoOptions selected=$result.Client_Member *></td>
			<td class="td22">Member Branch:</td>
			<td class="vtop ">
				<select name="Client_Member_Branch" class="select">
					<option value='null'>-- none --</option>
					<* html_options options=$field.Branch selected=$result.Client_Member_Branch *>
				</select>				
			</td>			
		</tr>	
		<tr>
			<td class="td22">Interests:</td>
			<td class="vtop ">
				<select class="select" multiple name="Client_Interests[]">		
					<* html_options options=$field.Client_Interests selected=$multiSelected.Client_Interests *>
				</select>					
			<td class="td22">Other Service Providers:</td>
			<td class="vtop "><textarea cols="50" name="Client_Service_Providers" id="Client_Service_Providers" rows="3" class="txt"><* $result.Client_Service_Providers *></textarea></td>						
		</tr>	
		<tr>
			<td class="td22">Permission to contact:</td>
			<td class="vtop "><* html_radios class="radio" name='Client_Permission_Contact' options=$yesnoOptions selected=$result.Client_Permission_Contact *></td>
			<td class="td22">Privacy information given:</td>
			<td class="vtop "><* html_radios class="radio" name='Client_Privacy' options=$yesnoOptions selected=$result.Client_Privacy *></td>
		</tr>			
		<tr>
			<td class="td22">Interpreter Required:</td>
			<td class="vtop "><* html_radios class="radio" name='Client_Interpreter' options=$yesnoOptions selected=$result.Client_Interpreter *></td>		
			<td class="td22">Notes:</td>
			<td class="vtop "><textarea cols="50" name="Client_Notes" id="Client_Notes" rows="3" class="txt"><* $result.Client_Notes *></textarea></td>									
		</tr>	
		<tr>
			<th  class="partition" colspan="4">Consumer</th>
		</tr>
		<tr>
			<td class="td22">First Name:</td>
			<td class="vtop "><input name="Consumer_First_Name" id="Consumer_First_Name" value="<* $result.Consumer_First_Name *>" type="text" class="txt" /></td>
			<td class="td22">Last Name:</td>
			<td class="vtop "><input name="Consumer_Last_Name" id="Consumer_Last_Name" value="<* $result.Consumer_First_Name *>" type="text" class="txt" /></td>
		</tr>
		<tr>
			<td class="td22">Lives with carer:</td>
			<td class="vtop "><* html_radios class="radio" name='Consumer_Lives_Carer' options=$yesnoOptions selected=$result.Consumer_Lives_Carer *></td>
			<td class="td22">Drug and Alcohol Issues:</td>
			<td class="vtop "><* html_radios class="radio" name='Consumer_Drug_Alcohol' options=$yesnoOptions selected=$result.Consumer_Drug_Alcohol *></td>
		</tr>
		<tr>
			<td class="td22 red">Diagnosis:</td>
			<td class="vtop ">
				<select name="Consumer_Diagnosis" class="select required">
					<option value='null'>-- none --</option>
					<* html_options options=$field.Consumer_Diagnosis selected=$result.Consumer_Diagnosis *>
				</select>				
			</td>
			<td class="td22">Age Range:</td>
			<td class="vtop ">
				<select name="Consumer_Age_Range" class="select">
					<option value='null'>-- none --</option>
					<* html_options options=$field.Age_Range selected=$result.Consumer_Age_Range *>
				</select>				
			</td>
		</tr>
		<tr>
			<td class="td22">History of Violence:</td>
			<td class="vtop "><* html_radios class="radio" name='Consumer_Violence' options=$yesnoOptions selected=$result.Consumer_Violence *></td>
			<td class="td22">Risk Assessment:</td>
			<td class="vtop "><* html_radios class="radio" name='Consumer_Risk' options=$yesnoOptions selected=$result.Consumer_Risk *></td>
		</tr>	
		<tr>
			<td class="td22">Nature of Illness:</td>
			<td class="vtop "><textarea cols="50" name="Consumer_Illness" id="Consumer_Illness" rows="3" class="txt"><* $result.Consumer_Illness *></textarea></td>			
			<td class="td22">Notes:</td>
			<td class="vtop "><textarea cols="50" name="Consumer_Notes" id="Consumer_Notes" rows="3" class="txt"><* $result.Consumer_Notes *></textarea></td>						
		</tr>
		
		<tr>
			<td colspan="4" class="td27">
			<input class="submit" id="submitbutton" type="submit" value=" Save "/>
			&nbsp;&nbsp;
			<input  type="button" value=" Back to list " class="btn" onClick="history.back();"/></td>
		</tr>
 </table>
 <input name="Contact_ID" type="hidden" value="<* $result.Contact_ID*>">  
</form>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script>
$(document).ready(function() { 
    // validate contact form on keyup and submit 
    $("#contact_form").validate();  
	//alert("last");
}); 
</script>
<!-- script type="text/javascript" src="/js/crmStaffCheck.js"></script -->

<* include file=$bottom_file *>